package com.zqwh.xtool.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.zqwh.yj.sdk.utils.LogUtils;

import static com.zqwh.xtool.ToolsApp.gRopenModel;

public class ScreenStatusReceiver extends BroadcastReceiver {

    @Override
    public void onReceive(Context context, Intent intent) {
        LogUtils.logout("action: "+intent.getAction());
        String SCREEN_ON = "android.intent.action.SCREEN_ON";
        String SCREEN_OFF = "android.intent.action.SCREEN_OFF";
        if (SCREEN_ON.equals(intent.getAction())) {
            LogUtils.logout("Screen On");
            gRopenModel.setRelay2(1);
        } else if (SCREEN_OFF.equals(intent.getAction())) {
            LogUtils.logout("Screen Off");
            gRopenModel.setRelay2(0);
        }
    }
}
